package com.itheima.exception;


import com.itheima.constant.ExceptionContant;

public class SQLContainRelationException extends RuntimeException {

    public SQLContainRelationException(String sort) {
        super(getMessage(sort));
    }

    private static String getMessage(String sort) {
        switch (sort) {
            case ExceptionContant.CLAZZ:
                return "对不起, 该班级下有学生, 不能直接删除";
            case ExceptionContant.DEPT:
                return "对不起，当前部门下有员工，不能直接删除！";
            default:
                return "发生未知的SQL关联异常";
        }
    }
}
